import { Controller, Get, HttpException, HttpStatus } from '@nestjs/common';
import { AppService } from './app.service';

@Controller('app')
export class AppController {
  constructor(private readonly appService: AppService) {}

  @Get('hello') async getHello(): Promise<string> {
    return await this.appService.getHello();
  }

  @Get('error')
  findAll() {
    throw new HttpException('资源未找到', HttpStatus.NOT_FOUND);
  }
}
